<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
<title>后台管理</title>
<script>
function checkpadd(){
	var quota=$.trim($("#quota").val());
	var num=$.trim($("#num").val());
	var stime=$.trim($("#stime").val());
	var etime=$.trim($("#etime").val());
	if(quota==''){parent.layer.msg('额度不能为空！',2,8); return false;}
	if(num==''){parent.layer.msg('生成数量不能为空！',2,8); return false;}
	if(stime==''||etime==''){
		parent.layer.msg('开始时间、结束时间不能为空！',2,8); return false;
	}else{
		var st=stime.split(' ');
		var ed=etime.split(' '); 
		if(toDate(st[0])>toDate(ed[0])){
			parent.layer.msg('开始时间不得大于结束时间', 2, 2);   return false;
		}
	}
}
</script>
</head>
<body class="body_ifm">
<div class="infoboxp"> 

<div class="admin_new_tip">
<a href="javascript:;" class="admin_new_tip_close"></a>
<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
<div class="admin_new_tip_list_cont">
<div class="admin_new_tip_list">操作提示</div>
</div>
</div>
<div class="clear"></div>
<div style="height:10px;"></div>

 
  <div class="tag_box">
    <iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
    <form name="myform" action="index.php?m=admin_prepaid&c=add" method="post" target="supportiframe" onSubmit="return checkpadd()" class="layui-form">
      <table width="100%" class="table_form" style="background:#fff;">
       <tr>
              <td colspan="2" bgcolor="#f0f6fb"><div class="admin_bold">添加卡号</div></td>
            </tr>
        <tr class="admin_table_trbg">
          <th>额　　度：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-block">
                 <div class="layui-input-inline">
                   <input class="layui-input input-text" type="text" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" name="quota" id="quota" value="{yun:}$pinfo.quota{/yun}" placeholder="请输入额度" size="40"/>
                 </div>
               </div>
            </div></td>
        </tr>
        <tr>
          <th>生成数量：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-block">
                 <div class="layui-input-inline">
                   <input class="layui-input input-text" type="text" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" name="num" id="num" placeholder="请输入生成数量" size="40"/>
                 </div>
               </div>
            </div></td>
        </tr>
        <tr class="admin_table_trbg">
        <th width="120">开始时间：</th>
        <td>
            <div class="layui-form-item">
              <div class="layui-input-block">
                 <div class="layui-input-inline">
                   <input class="layui-input input-text" type="text" name="stime" id="stime" value="{yun:}$pinfo.stime|date_format:'%Y-%m-%d'{/yun}" placeholder="开始时间"/>
                 </div>
               </div>
            </div></td>
      </tr>
      <tr >
        <th width="120">结束时间：</th>
        <td>
            <div class="layui-form-item">
              <div class="layui-input-block">
                 <div class="layui-input-inline">
                   <input class="layui-input input-text" type="text" name="etime" id="etime" value="{yun:}$pinfo.etime|date_format:'%Y-%m-%d'{/yun}" placeholder="结束时间"/>
                 </div>
               </div>
            </div></td>
      </tr> 
      <tr class="admin_table_trbg">
        <th width="120">状　　态：</th>
        <td>
            <div class="layui-form-item">
              <div class="layui-input-block">
                 <div class="layui-input-inline">
                   <select name="type" lay-filter="" id="type_val">
                      <option value="1">可用</option>
                      <option value="2">不可用</option>
                    </select>
                 </div>
               </div>
            </div>
        </td>
      </tr>
        <tr class="admin_table_trbg" >
          <td align="center" colspan="2">
			{yun:}if $info.id{/yun}
            <input type="hidden" name="id" value="{yun:}$info.id{/yun}"/>
            <input class="layui-btn layui-btn-normal" type="submit" name="submit" value="&nbsp;更 新&nbsp;"  />
            {yun:}else{/yun}
            <input class="layui-btn layui-btn-normal" type="submit" name="submit" value="&nbsp;添 加&nbsp;"  />
            {yun:}/if{/yun}
            <input class="layui-btn layui-btn-normal" type="reset" name="reset" value="&nbsp;重 置 &nbsp;" /></td>
        </tr>
      </table>
	  <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
    </form>
  </div>
</div>
<script>
layui.use(['layer', 'form','laydate'], function(){
    var layer = layui.layer
    ,form = layui.form
    ,laydate = layui.laydate
    ,$ = layui.$;
	laydate.render({
		elem: '#stime'
		,type: 'datetime'
	});
	laydate.render({
		elem: '#etime'
		,type: 'datetime'
	});
});
</script>
</body>
</html>